Skip to content

fix(run): stop per-pass advisory churn on large catalogs - #334

Merged
schickling-assistant merged 2 commits into
schickling-assistant/issue314-2-sidecar-watchesfrom
schickling-assistant/2026-08-24-2026-08-24-issue314-pr1
Aug 25, 2026
Merged

fix(run): stop per-pass advisory churn on large catalogs#334
schickling-assistant merged 2 commits into
schickling-assistant/issue314-2-sidecar-watchesfrom
schickling-assistant/2026-08-24-2026-08-24-issue314-pr1

Conversation

@schickling-assistant

Copy link
Copy Markdown
Contributor

Problem

Even with a correct watch, each reconcile pass on large catalogs repeated identical advisory work: for every agent workspace that is not inside a Git repository, materialization spawned git rev-parse (plus captured stderr) only to fail, and print_report re-printed the identical warning every pass. Measured live on an oversized production catalog: ~28 failed spawns per pass at a spun-up cadence, 7,028 duplicate warning lines in hours.

Goal

A persistent advisory failure costs one spawn-free answer and one diagnostic line — not per-pass churn.

Decisions

  • Marker probe before spawn: git_exclude now checks for a .git entry up the ancestor chain (the exact probe is_git_tracked already uses) and answers "not a Git worktree" without a process. .git may be a directory or file (linked worktrees); exists covers both. If a workspace later becomes a repo, the probe succeeds again and the real git path resumes — no cache to invalidate.
  • Recurring-warning dedup in the supervisor loops: warnings persisting across passes are emitted once; if the condition clears and returns, it is surfaced again. Applied to both the catalog loop (up_loop_until) and the spec loop (up_loop_specs). This mirrors the existing reported_flapping pattern.

Verification

  • New unit test: git_exclude on markerless workspace fails with "no .git marker" without touching git; a .git directory above re-enables the git path.
  • New e2e test drives up_loop_until over a catalog whose agent declares render { git-exclude } with a non-Git workspace: several passes run, exactly one warning is delivered.
  • Live reproduction (synthetic catalog, four non-Git workspaces, 1 s interval): each of the four warnings printed once across eight passes; idle CPU 3 ticks / 4 s.

Complexity

One helper function plus a two-method dedup struct. No new dependencies.

Concerns

  • Dedup applies to all supervisor warnings, so genuinely intermittent-but-identical warnings appear once per continuous occurrence rather than per pass. That is the intended semantic ("diagnose once while unchanged").

References

Part of the #314 stack. Base: #318 (sidecar watches).

Posted on behalf of @schickling
field value
agent_identity unknown
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.0.3
agent_runtime OMP 18.0.3
tooling_profile dotfiles@f33cd9c-dirty

@schickling-assistant
schickling-assistant marked this pull request as ready for review August 24, 2026 21:18
@schickling-assistant

Copy link
Copy Markdown
Contributor Author

@codex Please review this PR.

Posted on behalf of @schickling
field value
agent_identity unknown
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.0.3
agent_runtime OMP 18.0.3
tooling_profile dotfiles@f33cd9c-dirty

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 422b574aa7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/run.rs Outdated
schickling-assistant and others added 2 commits August 25, 2026 08:27
Two reconcile-pass costs repeat every pass even when nothing changed:

- git-exclude spawned `git rev-parse` per op per pass and failed for
  workspaces that are plain directories (28 agents on dev3 → ~28 spawns
  plus captured git stderr every pass). Probe for a `.git` marker up the
  ancestor chain first — the same probe is_git_tracked already uses —
  and answer "not a Git worktree" without a process spawn.
- print_report re-printed identical warnings every pass (~7k lines in
  hours on dev3). The supervisor loop now deduplicates warnings that
  persist across passes while still re-surfacing one that clears and
  returns; applied to both the catalog and spec loops.

Part of #314.

Co-authored-by: schickling-assistant <schickling-assistant@users.noreply.github.com>
agent-identity: unknown
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.3
agent-runtime: OMP 18.0.3
tooling-profile: dotfiles@f33cd9c-dirty
Rewiring the spec loop's warning filter dropped the one-shot crash-loop
surface: the GAVE UP diagnostic and the bus notification to the agent's
supervisor never fired for spec-based teams even though the report still
listed the task as flapping. Restore the deduplicated surfacing block
alongside the warning filter.

Co-authored-by: schickling-assistant <schickling-assistant@users.noreply.github.com>
agent-identity: unknown
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.3
agent-runtime: OMP 18.0.3
tooling-profile: dotfiles@f33cd9c-dirty
@schickling-assistant
schickling-assistant force-pushed the schickling-assistant/2026-08-24-2026-08-24-issue314-pr1 branch from 422b574 to 49c5c93 Compare August 25, 2026 06:28
@schickling-assistant
schickling-assistant merged commit 55efd31 into main Aug 25, 2026
1 of 2 checks passed
@schickling-assistant
schickling-assistant deleted the schickling-assistant/2026-08-24-2026-08-24-issue314-pr1 branch August 25, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant